
const msg = 'Error:foo is not dfined.';

console.log(msg.startsWith('Error'));//判断是否以‘Error’开始
console.log(msg.endsWith('.'));//判断是否以‘.’结尾
console.log(msg.includes('foo'));//是否包含‘foo’
